dojo.event.topic.subscribe("/value", function(textEntered, date, widget){
    //alert('value changed');
    //textEntered: String enetered in the textbox
    //date: JavaScript Date object with the value selected
    //widet: widget that published the topic
	//alert(date);
	//1969-12-31T00:00:00-03:00

		var trimed = trim(textEntered);
    	if( textEntered == null || textEntered.length == 0 || trimed == null || trimed.length == 0 || date.match("1969-12-31") != null ) {
			widget.setValue(new Date());
    	}
	});

function trim(s)
{
    var l=0; var r=s.length -1;
    while(l < s.length && s[l] == ' ')
    {     l++; }
    while(r > l && s[r] == ' ')
    {     r-=1;     }
    return s.substring(l, r+1);
}
